<!--回复的作者-->
<script setup>
import UserLink from "@/components/common/link/UserLink.vue";
import {AccountStatus} from "@ginstone/nga-api/dist/src/enums/AccountStatus";
import {toRefs} from "vue";

const props = defineProps({
  data: {type: Object},
})

const {data} = toRefs(props)
</script>

<template>
  <!--匿名用户-->
  <span v-if="data.anonymous" class="anonymous-nickname username">
                    <el-tag effect="dark" type="danger">匿名</el-tag>
                    {{ data.nickname }}
                </span>
  <!--已注销用户-->
  <span v-else-if="data.accountStatus===AccountStatus.UNREGISTERED">{{ data.username }}</span>
  <!--常规用户-->
  <user-link v-else :user-id="data.userId" :username="data.username">
    <span class="username">{{ data.username }}</span>
  </user-link>
</template>

<style scoped>
.anonymous-nickname {
  color: peru;
}

.username {
  font-weight: bold
}

</style>